import service from "../../utils/request"

export const getMealPage = async (page: number, meal_name: string): Promise<PageResult<ListMeal[]>> =>
    await service.get(`/vip-meal/page?page=${page}&meal_name=${meal_name}`)

export const addMeal = async(data: Meal): Promise<Result<string>> =>
    await service.post(`/vip-meal`, data)

export const editMeal = async (id: string, data: Meal): Promise<Result<string>> =>
    await service.patch(`/vip-meal/${id}`, data)

export const delMeal = async (id: string): Promise<Result<string>> =>
    await service.delete(`/vip-meal/${id}`)

export const manyDelMeal = async (ids: string): Promise<Result<string>> =>
    await service.delete(`/vip-meal/many/${ids}`)

export const getMealAll = async (): Promise<Result<ListMeal[]>> =>
    await service.get(`/vip-meal`)
